﻿#ifndef DAPROJECT_H
#define DAPROJECT_H
#include <QObject>
#include "DAGlobals.h"
#include "DAAbstractNodeLinkGraphicsItem.h"
#include "DAWorkFlowOperateWidget.h"
namespace DA
{
DA_IMPL_FORWARD_DECL(DAProject)
class DAWorkFlowGraphicsScene;

/**
 * @brief 负责整个节点的工程管理
 */
class DAProject : public QObject
{
    Q_OBJECT
    DA_IMPL(DAProject)
public:
    DAProject(DAWorkFlowOperateWidget* widget, QObject* p = nullptr);
    ~DAProject();
    //获取项目名
    QString getProjectName() const;
    void setProjectName(const QString& projectName);
    //工程路径
    QString getProjectPath() const;
    void setProjectPath(const QString& projectPath);
    //获取工程画布
    DAWorkFlowGraphicsScene* getScene() const;
    void setScene(DAWorkFlowGraphicsScene* scene);
    //加载工程
    bool load(const QString& path);
    //保存工程
    bool save(const QString& path);
    //清除工程
    void clear();

public:
    static QString directionToStr(DANodeLinkPoint::Direction direction);
    static DANodeLinkPoint::Direction strToDirection(const QString& direction);
};
}  // namespace DA
#endif  // FCPROJECT_H
